package com.phospherus.flow.repository

import com.phospherus.common.repository.BaseRepository
import com.phospherus.flow.entity.HiveToDo
import org.springframework.data.jpa.repository.Modifying
import org.springframework.data.jpa.repository.Query
import org.springframework.data.repository.query.Param

/**
 * @author songjinlong
 * @version 1.0
 * @since 2018/1/3
 */
interface HiveToDoRepository : BaseRepository<HiveToDo, Long> {
    fun findByFormInstIdAndUserId(formInstId: Long?, userId: Long?): HiveToDo?
    @Modifying
    @Query("update hive_to_do set curr_user_name=:currUserName where form_inst_id=:formInstId", nativeQuery = true)
    fun modifyCurrUserName(@Param("formInstId") formInstId: Long?, @Param("currUserName") currUserName: String?)
}